<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>堆叠顺序 z-index</title>
		<style type="text/css">
			.wrap {
				width: 80%;
				height: 850px;
				margin: 0 auto;
				background-color: #E5E5E5;
				position: relative;
				z-index: 6;
			}
			.inner {
				width: 80%;
				height: 500px;
				position: absolute;
				top: 100px;
				left: 90px;
			}
			img {
				position: absolute;
				top: 0;
				width: 100%;
				z-index: 3;
			}
			.control {
				width: 50px;
				height: 100px;
				background-color: rgba(0,0,0,.5);
				color: #fff;
				font-size: 30px;
				line-height: 100px;
				text-align: center;
				position: absolute;
			}
			.left {
				z-index:4 ; 
				top: 170px;
				left: 150px;
				margin-top: -50px;
			}
			.right {
				z-index: 5;
				top: 170px;
				right: 0;
				margin-top: -50px;
			}
		</style>
	</head>
	<body>
		<!-- 堆叠顺序 z-index
			1、必须是配合position 定位来使用，relative absolute fixed sticky
			2、如果元素设置了定位，默认有个属性 z-index = 0
			3、取值越大，越靠上
		 -->
		 
		 <div class="wrap">
			 <div class="inner">
				 <div class="control left"> &lt; </div>
				 <div class="control right"> &gt; </div>
				 <img src="../../img/c05.jpg" alt="">
			 </div>
		 </div>
	</body>
</html>
